package com.family.web.controller.pedigree;


import com.family.common.core.domain.AjaxResult;
import com.family.pedigree.domain.FamilyNode;
import com.family.pedigree.service.IFamilyNodeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 家族数节点信息 前端控制器
 * </p>
 *
 * @author forever
 * @since 2024-11-10
 */
@Deprecated
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/family/node")
public class FamilyNodeController {

    private final IFamilyNodeService familyNodeService;


    /**
     * 添加节点
     */
    @PostMapping
    public AjaxResult add(@RequestBody FamilyNode familyNode) {
        familyNodeService.add(familyNode);
        return AjaxResult.success();
    }

    /**
     * 修改节点
     */
    @PutMapping
    public AjaxResult edit(@RequestBody FamilyNode familyNode) {
        familyNodeService.edit(familyNode);
        return AjaxResult.success();
    }

    /**
     * 删除节点
     */
    @DeleteMapping("/{nodeId}")
    public AjaxResult delById(@PathVariable Long nodeId) {
        familyNodeService.delById(nodeId);
        return AjaxResult.success();
    }


}
